// 后端拦截路由  所有拦截都在这个文件
const express = require('express')
const router = express.Router()
const product = require('../ctrl/product')
const uploadConfig = require('../utils/uploadConfig')
const order = require('../ctrl/order')
const refund = require('../ctrl/cbt/refund')//cbt
const user = require('../ctrl/user')
const stu = require('../ctrl/stu')
const scene = require('../ctrl/scene')
const roleInfo = require('../ctrl/roleInfo')
const addRoleInfo = require('../ctrl/addRoleInfo')
const delRoleInfo = require('../ctrl/delRole')
const upDateRoleInfo = require('../ctrl/updateRoleInfo')
const memberInfo = require('../ctrl/memberInfo')
const searchMemberInfo = require('../ctrl/searchMemberInfo')
const deduction = require('../ctrl/deduction')
const purchase = require('../ctrl/purchase')
const promotion = require('../ctrl/promotion')
const system = require('../ctrl/system')
const updateMemberInfo = require('../ctrl/updateMemeberInfo')
const updateMemberInfo2 = require('../ctrl/updateMemeberInfo2')
//文件上传
router.post("/upload", uploadConfig.single("file"), (req, res) => { //单文件上传
  res.send(req.body.imgUrl);//上传成功之后  给客户端响应
})


//王驰
router.get('/product/getProduct', product.getProduct)
router.get('/product/getProduct1', product.getProduct1)
router.get('/product/getProduct2', product.getProduct2)
router.get('/product/getClassify', product.getClassify)
router.get('/product/getProductBrand', product.getProductBrand)
router.post('/product/addProduct', product.addProduct)
router.post('/product/changeProduct', product.changeProduct)
router.post('/product/quiteProduct1', product.quiteProduct1)
router.post('/product/quiteProduct2', product.quiteProduct2)
router.post('/product/changeProductGrounding', product.changeProductGrounding)
router.post('/product/changeProductGrounding1', product.changeProductGrounding1)
router.post('/product/changeProductState', product.changeProductState)
router.post('/product/changeProductState1', product.changeProductState1)
router.post('/product/changeProductState2', product.changeProductState2)
router.post('/product/changeProductState3', product.changeProductState3)
router.post('/product/changeProductNum', product.changeProductNum)
router.post('/product/delProduct', product.delProduct)
router.post('/product/delProduct2', product.delProduct2)

//小吴
router.get('/roleInfo/getRoleInfo', roleInfo.getRoleInfo)
router.get('/roleInfo/AddRoleInfo', addRoleInfo.AddRoleInfo)
router.get('/roleInfo/delRoleInfo', delRoleInfo.delRoleInfo)
router.post('/roleInfo/upDateRoleInfo', upDateRoleInfo.upDateRoleInfo)
router.get('/user/getMemberInfo', memberInfo.getMemberInfo)
router.get('/user/searchMemberInfo', searchMemberInfo.searchMemberInfo)
router.post('/user/updateMemberInfo', updateMemberInfo.updateMemberInfo)
router.post('/user/updateMemberInfo2', updateMemberInfo2.updateMemberInfo2)

//---------------------------PC


// cbt
// ----------退款原因---
router.get('/refundReason/getReason', refund.getReason)//渲染数据
router.post('/refundReason/changeState', refund.changeState)// 更改启用状态
router.post('/refundReason/selectReason', refund.selectReason)// 更改启用状态
router.post('/refundReason/eidtReason', refund.eidtReason)// 编辑
router.post('/refundReason/addReason', refund.addReason)// 添加
router.post('/refundReason/delReason', refund.delReason)// 删除
// ---------退货
router.get('/refundReason/getRefundGood', refund.getRefundGood)//渲染数据
router.post('/refundReason/selectGood', refund.selectGood)// 删除
// ---------退款
router.get('/refundReason/getRefundMoney', refund.getRefundMoney)//渲染数据
router.post('/refundReason/selectMoney', refund.selectMoney)// 删除
router.post('/refundReason/addOrderRefund', refund.addOrderRefund)// 添加
router.post('/refundReason/refund', refund.refund)// 更改订单orState
router.post('/refundReason/selectSuccess', refund.selectSuccess)// 查询已退款，已完成的
router.post('/refundReason/dealOrderBtn', refund.dealOrderBtn)// 修改订单
router.get('/refundReason/getOrder', refund.getOrder)// 修改订单


//赵君豪
router.get('/deduction/getAllData', deduction.getAllData)//抵扣查询
router.post('/deduction/getAppointData', deduction.getAppointData)//指定抵扣查询
router.post('/deduction/addData', deduction.addData)//抵扣添加
router.post('/deduction/delData', deduction.delData)//抵扣删除数据
router.post('/deduction/editData', deduction.editData)//抵扣编辑

router.get('/purchase/getAllData', purchase.getAllData)//抢购查询
router.post('/purchase/getAppointData', purchase.getAppointData)//指定抢购查询
router.post('/purchase/isProductId', purchase.isProductId)//判断是否有商品Id
router.post('/purchase/addData', purchase.addData)//抢购添加
router.post('/purchase/delData', purchase.delData)//抢购删除数据
router.post('/purchase/editData', purchase.editData)//抢购编辑

router.get('/promotion/getAllData', promotion.getAllData)//促销查询
router.post('/promotion/getAppointData', promotion.getAppointData)//指定促销查询
router.post('/promotion/addData', promotion.addData)//促销添加
router.post('/promotion/delData', promotion.delData)//促销删除数据
router.post('/promotion/editData', promotion.editData)//促销编辑
router.post('/promotion/getProductDataId', promotion.getProductDataId)//商品管理查询
router.post('/promotion/delProductData', promotion.delProductData)//商品管理删除数据
router.post('/promotion/getAllProductData', promotion.getAllProductData)//查询所有商品
router.post('/promotion/getAppointProductData', promotion.getAppointProductData)//指定商品查询
router.post('/promotion/addProductData', promotion.addProductData)//促销添加




//hx
router.post('/noToken/login', system.login)// 登录
router.get('/user/getUerList', user.getUerList)//渲染用户列表数据
router.post('/user/getUserShopAddress', user.getUserShopAddress)//查询用户的收货地址
router.post('/user/addUser', user.addUser)//新增用户
router.post('/user/deleteUser', user.deleteUser)//删除用户
router.post('/user/getUserOrder', user.getUserOrder)//获取用户订单
router.post('/user/detailUser', user.detailUser)//更改用户信息
router.post('/user/searchUser', user.searchUser)//搜索用户信息
router.get('/user/getUserPurchasingPower', user.getUserPurchasingPower)//获取用户购买力






//陈玉----订单管理
router.get('/order/getOrderInfo', order.getOrderInfo)
router.post('/order/searchOrderByKeys', order.searchOrderByKeys)
router.post('/order/changeManyState', order.changeManyState)
router.post('/order/delManyOrderInfo', order.delManyOrderInfo)
router.post('/order/getOrderById', order.getOrderById)
router.post('/order/addOrder', order.addOrder)

router.post('/order/getAddressById', order.getAddressById)
router.post('/order/getProductById', order.getProductById)
router.get('/order/getClassifyOne', order.getClassifyOne)
router.post('/order/getClassifyChild', order.getClassifyChild)
router.post('/order/getUpProductByLabelId', order.getUpProductByLabelId)
router.post('/order/getRefundByOrderId', order.getRefundByOrderId)

router.get('/order/getUpClassifyInfo', order.getUpClassifyInfo)

//比尔盖、赖
//专区信息接口
router.get('/stu/getZoneinfo', stu.getZoneinfo)

//专区删除专区信息
router.post('/stu/deleteid', stu.deleteid)

//专区查询接口
router.get('/stu/Inquire', stu.Inquire)

//专区编辑接口
router.post('/stu/editable', stu.editable)
//专区添加接口
router.post('/stu/addTo', stu.addTo)

//标签信息接口
router.get('/stu/getLabel', stu.getLabel)

//标签编辑接口
router.post('/stu/compile', stu.compile)

//标签删除专区信息
router.post('/stu/remove', stu.remove)

//专区添加接口
router.post('/stu/add', stu.add)

//交易页面接口
router.get('/stu/dealsDer', stu.dealsDer)

//商品页面接口
router.get('/stu/goods',stu.goods)

//商品页面接添加
router.post('/stu/increase',stu.increase)
//商品删除
router.post('/stu/omit',stu.omit)

// 路建林------场景管理，搜索管理
router.get('/scene/getScenario',scene.getScenario)
router.get('/scene/getSearc',scene.getSearc)
router.get('/scene/getcom',scene.getcom)
router.get('/scene/getprin',scene.getprin)
router.post('/scene/delScenario',scene.delScenario)
router.post('/scene/delSearchinfo',scene.delSearchinfo)
router.get('/scene/getSceneId',scene.getSceneId)
router.post('/scene/addTo',scene.addTo)
router.post('/scene/addSearc',scene.addSearc)
router.post('/scene/editable',scene.editable)
router.post('/scene/editsearc',scene.editsearc)

module.exports = router